package com.adminx.controller.admin;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.adminx.pojo.MessageDetailPojo;
import com.adminx.service.MessageDetailService;
import com.adminx.util.PageResults;

@Controller
@RequestMapping("messageDetail")
public class MessageDetailController {
	
	@Autowired
	private MessageDetailService messageDetailService;
	
	/**
	 * 分页查询�?��消息
	 * @param map
	 * @return
	 */
	@RequestMapping(value = "/query", method = RequestMethod.GET) 
	public String query(ModelMap map, Integer pageIndex, Integer pageSize, Long id){
		try {
			PageResults<MessageDetailPojo> pageResults = this.messageDetailService.query(pageIndex, pageSize, id);
			map.put("pageResults", pageResults);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "admin/message/message_detail_data";
	}
}
